Repository navigation
Conversation
You still need to change the signature to indicate the value can be null or an array |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
What I meant is I don't need to add a It's true that I need to allow for |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
FYI @tjcafferkey -- if you'd like to give this a review 😄 |
|
@swissspidy Thank you, good point! Added in 5566464. (I opted to write "to suppress the block" rather than "remove", as the latter would sound a bit like the block has already been inserted and is being removed. LMK if that's okay, or if you'd prefer "remove" after all.) |
5566464 to
9df509d
Compare
|
Rebased. |
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
I'm going to try and review this today if required 😄 |
|
@tjcafferkey If you'd like to, the sooner the better - beta 2 release party kicks off in around 2hrs. |
gziolo
left a comment
There was a problem hiding this comment.
Code changes look good to me, but I would appreciate sanity check from @tjcafferkey.
|
Committed to Core in https://core.trac.wordpress.org/changeset/57668. |
The
hooked_block_typesfilter allows extenders to conditionally insert a block, based on the anchor block's ''type''.However, it's currently not possible to base the criterion for insertion on the value of an attribute of the anchor block.
One fairly straight-forward way to implement this would be to allow the
hooked_block(andhooked_block_{$hooked_block_type}) filter -- which has access to the entire parsed anchor block, i.e. including attributes -- to returnnull, which Block Hooks could then interpret as "do not render hooked block". (This would avoid changing thehooked_block_typesfilter's signature in an awkward way.)Trac ticket: https://core.trac.wordpress.org/ticket/60580
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.